# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=gnome-builder
pkgver=3.24.2
pkgrel=3
pkgdesc="An IDE for writing GNOME-based software"
url="https://wiki.gnome.org/Apps/Builder"
arch=(i686 x86_64)
license=(GPL3)
depends=(gtksourceview3 devhelp libgit2-glib gjs python-gobject clang desktop-file-utils
         ctags libpeas vte3 vala python-jedi autoconf-archive sysprof flatpak gspell)
makedepends=(intltool llvm gobject-introspection gtk-doc yelp-tools appstream-glib vala git
             mm-common)
optdepends=('gnome-code-assistance: Legacy assistance services')
groups=(gnome-extra)
_commit=fdf02de8614a675e3786006959251edf8b9de6de  # tags/GNOME_BUILDER_3_24_2^0
source=("git+https://git.gnome.org/browse/gnome-builder#commit=$_commit")
sha256sums=('SKIP')


pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^GNOME_BUILDER_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib --enable-gtk-doc --enable-meson-templates
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  make -k check || :
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
